using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WbsEditor
{
    public partial class EnterWorkItemIdForm : Form
    {
        public EnterWorkItemIdForm()
        {
            InitializeComponent();
        }

        private string _labelText;
        public string LabelText
        {
            get
            {
                if (string.IsNullOrEmpty(_labelText))
                    _labelText = _label.Text;
                return _labelText;
            }
            set
            {
                _labelText = value;
                if (!string.IsNullOrEmpty(_labelText))
                {
                    _label.Text = _labelText;
                }
            }
        }

        public string CheckBoxText
        {
            set
            {
                if (null != value)
                {
                    _checkBox.Text = value;
                    _checkBox.Visible = true;
                }
                else
                {
                    _checkBox.Visible = false;  
                }
            }
            get
            {
                return _checkBox.Text;
            }
        }

        public bool CheckBoxChecked
        {
            get
            {
                return _checkBox.Checked;
            }
            set
            {
                _checkBox.Checked = value;
            }
        }

        public int WorkItemId
        {
            get
            {
                int id = 0;
                int.TryParse(workItemId.Text, out id);
                return id;
            }

            set
            {
                workItemId.Text = value.ToString();
            }
        }
    }
}